package excercise;

public class EX04_OOP {
	
	
	
	public static void main(String[] args) {
		
		//사각형
		
		Retangle r = new Retangle();
		
		r.color = "red";
		r.height = 4F;
		r.width = 40F;
		r.getArea();
		r.getpremetal();
		
		Retangle a = new Retangle();
		a.color = "orange";
		a.height = 3.5F;
		a.width = 35.9F;
		a.getArea();
		a.getpremetal();
		
		//선풍기
		
		Fan b = new Fan();
		b.speed = "FAST";
		b.radius = 10;
		b.on = true;
		b.color1 = "yellow";
		b.string();
		
		Fan c = new Fan();
		c.speed = "MEDIUM";
		c.radius = 5;
		c.on = false;
		c.color1 = "blue";
		c.string();
		
		//은행 계좌
		
		
		Account d = new Account();
		d.aid = 1122;
		d.balance = 20000;
		d.interestRate = 4.5F;
		d.dateCreated = "2013-04-13 15:11:50";
		d.string2();
		d.string3();
		
		
		//주식 정보
		
		Stork e = new Stork();
		e.sname = "경영기술";
		e.previousClosingPreice = 1000000;
		e.currentPrice = 750000;
		e.getChangepercent();
		
	}
	
	//main
	
}	//class

class Retangle{
	
	float width = 1.0F;
	
	float height = 1.0F;
	
	String color = "white";
	
	void getArea(){
		System.out.println(width * height);
	}
	
	void getpremetal(){
		System.out.println(2 * width + 2 * height);
	}
	
}
class Fan {
	final int SLOW = 1;
	final int MEDIUM = 2;
	final int FAST = 3;
	String speed = "SLOW";
	boolean on = false;
	float radius = 5F;
	String color1 = "blue";
	
	void string(){
		System.out.println(speed + " " + color1 + " " + radius + " " +on);
	}
	
}
class Account{
	
	int aid = 0;
	int balance = 0;
	float interestRate = 0;
	String dateCreated;
	void string2(){
		System.out.println("2500 인출 후 잔액은 " + (20000 - 2500) + " 이며" + "월간 이자율은 "
				+ 4.5 / 12 + " " + dateCreated);
	}
	void string3(){
		System.out.println("3000 인출 후 잔액은 " + (20000 - 3000) + " 이며" + "월간 이자율은 "
				+ 4.5 / 12 + " " + dateCreated);
	}
	void getMonthlylnterestRate(){
		System.out.println("월간 이자율은 " + interestRate / 12 + " 입니다");
	}
	float getMonthlylnterestRate2(){
		return interestRate / 12;
	}
	
}

class Stork{
	
	String sname;
	float previousClosingPreice;
	int currentPrice;
	void getChangepercent(){
		System.out.println(sname + " " + currentPrice+ " " + 
						(int)previousClosingPreice + " " + "주가 변동율은 " + 25 + "%");
	}
	
	
}
